package com.gljx.web.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gljx.web.Entity.JournalEntry.TrainDeductAccountsJournal;
import com.gljx.web.dao.TrainDeductAccountsJournalMapper;
import com.gljx.web.service.TrainDeductAccountsJournalService;

@Service
@Transactional
public class TrainDeductAccountsJournalServiceImpl implements TrainDeductAccountsJournalService {
	
	@Autowired
	private TrainDeductAccountsJournalMapper  trainDeductAccountsJournalMapper;
		
	
	@Override
	public List<TrainDeductAccountsJournal> selTrainDeductAccountsJournalTwo(Map map) {
		// TODO Auto-generated method stub
		List<TrainDeductAccountsJournal> trainDeductAccountsJournalList=trainDeductAccountsJournalMapper.selTrainDeductAccountsJournalTwo(map);
		for (TrainDeductAccountsJournal trainDeductAccountsJournal : trainDeductAccountsJournalList) {
			if(trainDeductAccountsJournal.getExamCount() == 1 || trainDeductAccountsJournal.getExamCount() == null){
				trainDeductAccountsJournal.setStudentExamState("初考");
			}else if(trainDeductAccountsJournal.getExamCount() == 2){
				trainDeductAccountsJournal.setStudentExamState("补考一次");
			}else if(trainDeductAccountsJournal.getExamCount() == 3){
				trainDeductAccountsJournal.setStudentExamState("补考两次");
			}else if(trainDeductAccountsJournal.getExamCount() == 4){
				trainDeductAccountsJournal.setStudentExamState("补考三次");
			}else{
				trainDeductAccountsJournal.setStudentExamState("补考四次");
			}			
		}
		return trainDeductAccountsJournalList;
	}


	@Override
	public List<TrainDeductAccountsJournal> selTrainDeductAccountsJournalThree(Map map) {
		// TODO Auto-generated method stub
		List<TrainDeductAccountsJournal> trainDeductAccountsJournalList=trainDeductAccountsJournalMapper.selTrainDeductAccountsJournalThree(map);
		for (TrainDeductAccountsJournal trainDeductAccountsJournal : trainDeductAccountsJournalList) {
			if(trainDeductAccountsJournal.getExamCount() == 1 || trainDeductAccountsJournal.getExamCount() == null){
				trainDeductAccountsJournal.setStudentExamState("初考");
			}else if(trainDeductAccountsJournal.getExamCount() == 2){
				trainDeductAccountsJournal.setStudentExamState("补考一次");
			}else if(trainDeductAccountsJournal.getExamCount() == 3){
				trainDeductAccountsJournal.setStudentExamState("补考两次");
			}else if(trainDeductAccountsJournal.getExamCount() == 4){
				trainDeductAccountsJournal.setStudentExamState("补考三次");
			}else{
				trainDeductAccountsJournal.setStudentExamState("补考四次");
			}			
		}
		return trainDeductAccountsJournalList;
	}

}
